package com.mikeli.javacourse.lesson5;

import lombok.Data;
import lombok.ToString;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component("klass2")
@ToString
@Data
public class Klass {
    @Autowired(required = false)
    Student student;
    private String klassName;
    public Klass() {
        this.klassName = "我是Component 注解生成的";
        if(student!=null){
            student.setName("我是condition 注解生成的");
        }
    }
}
